package Views;

import Views.Base.BaseViewDisplayFlights;
import Source.DisplayFlights;
import UCM.UCDisplayFlights;

/**
 * Defines the view display class
 * @author Jason Sorbello
 */
public class ViewDisplayFlights extends BaseViewDisplayFlights {

    private final UCDisplayFlights UCDisplayFlights = new UCDisplayFlights(this);
    private DisplayFlights model;

    /**
     * Construction the initualises the view
     * @param view
     */
    public  ViewDisplayFlights() {
        displayFlightsButton.addActionListener(new AdapterUCCToAL(UCDisplayFlights));
        setVisible(true);
        validate();
    }

    public void loadTo(DisplayFlights model) {
        this.model = model;
    }

    /**
     * sets the displays flights panel visible
     * @param flightsInfoPanel
     */
    public void setDisplayFlightsVisible() {
        ViewMain.getInstance().updateDisplayFlights(model.getFlightList());
//        view.setCenterPanel(model.getFlightList());
//        view.add(view.getFlightsPanel(), BorderLayout.CENTER);
//        view.pack();

    }
}
